import styled from "styled-components";

interface SortSelectProps {
  selectedSortType: string;
  setSelectedSortType: React.Dispatch<React.SetStateAction<string>>;
}

const StyledSelectWrapper = styled.div`
  margin-top: 10px;
`;

const StyledSelect = styled.select`
  border: none;
`;

export default function Select({
  selectedSortType,
  setSelectedSortType,
}: SortSelectProps) {
  return (
    <StyledSelectWrapper>
      <StyledSelect
        value={selectedSortType}
        onChange={(e) => setSelectedSortType(e.target.value)}
        style={{ marginTop: "10px" }}
      >
        <option value="">По умолчанию</option>
        <option value="title">По названию</option>
        <option value="body">По тексту</option>
      </StyledSelect>
    </StyledSelectWrapper>
  );
}
